<header id="page-header"> 
    <h1>Gönderimler</h1> 
</header>

<nav id="shortcuts">
    <ul>
        <li><a href="<?php echo site_url('backend/mail_send/send') ?>" class="add">Yeni Gönder</a></li>
    </ul>
    <br class="clear-both" />
</nav>

<div id="content">
	<?php echo $this->session->flashdata('status') ?>
	
	<h3>Gönderimler (<?php echo $result['total_rows']; ?>)</h3>

	<table class="list">

        <thead>
            <tr>
                <th >Mail Konusu</th>
                <th >Gönderim Tarihi</th>
                <th >Durum</th>
                <th >Detay</th>
            </tr>
        </thead>

		<tbody>
			<?php if($result['total_rows']): ?>
				<?php foreach ($result['rows'] as $row): ?>
					<tr >
						<td><?php echo $row->subject ?></td>
						<td><?php echo format_date($row->date_add) ?></td>
						<td>
							<progress value="<?php echo $row->num_sent; ?>" max="<?php echo $row->total; ?>"></progress><br />
							(<?php echo $row->num_sent; ?> / <?php echo $row->total; ?>) <?php echo $status[$row->status]; ?>
						</td>
                        <td>
                        	<?php if($row->status == '0'): ?>
	                            <a href="<?php echo site_url("backend/sent/continue_sent/{$row->id}"); ?>" title="Devam Et"><img src="assets/backend/icon/luna/refresh.png" alt="" /></a>
							<?php endif; ?>
                            <a href="<?php echo site_url("backend/sent/delete/{$row->id}"); ?>" title="Sil" onclick="return confirm('Silme İşlemini Onaylıyormusunuz?')"><img src="assets/backend/icon/luna/trash.png" alt="" /></a>
                        </td>
					</tr>
				<?php endforeach; ?>
			<?php else: ?>

				<tr>
					<td colspan="4">
						<div class="notification info">0 Sonuç</div>
					</td>
				</tr>

			<?php endif; ?>
		</tbody>

	</table>

	<?php echo $pagination; ?>

</div><!-- // #content -->

<?php return FALSE; ?>


<!-- main -->
<div id="main">
    <!--Orta-->
    <div id="orta" class="sola">

        <div class="head">
            <h1>Gönderilen Mailler (<?php echo $total_rows ?>)</h1>
            
            <ul>
            	<li><a href="#raporlar" rel="fancybox_tip2" onclick="return false"><img src="assets/icons/small_icons/Hint.png" alt="" border="0" /> Raporlar Nedir?</a></li>
            </ul>            
        </div>

        <?php echo $this->session->flashdata('info') ?>
		
		<table class="list">

            <thead>
                <tr>
                    <th >Mail Konusu</th>
                    <th >Gönderim Tarihi</th>
                    <th >Durum</th>
                    <th >Detay</th>
                </tr>
            </thead>

            <tbody>
            <?php $i = 0; if ($total_rows) { foreach ($rows as $row) { ?>

                <tr >
                    <td><?php echo $row->subject ?></td>
                    <td><?php echo my_date($row->date_add) ?></td>
                    <td><?php echo $status[$row->status]; ?></td>
                    <td>
                        <a href="<?php echo site_url("report/sent_detail/?sent_id={$row->id}"); ?>" title="Detayları gör" class="table_icon"><img src="assets/icons/small_icons/Text preview.png" alt="" /></a>
                        <a href="<?php echo site_url("report/delete/{$row->id}") ?>" title="Bu raporu sil" class="table_icon" onclick="return confirm('Bu raporu silmek istediğinizden eminmisiniz?')"><img src="assets/icons/small_icons/Delete.png" alt="" /></a>
                    </td>
                </tr>

        		<?php $i++; } } else { ?>

                <tr>
                    <td colspan="4"><div class="notification info">Gönderilmiş herhangi bir mail yok.</div></td>
                </tr>

        		<?php } ?>
            </tbody>

        </table>

        	<?php echo $this->pagination->create_links(); ?>
			<div style="margin-top:10px">
		        <center>
			        <script type="text/javascript">
			        	<!--
							google_ad_client = "pub-3975648312722607";
							/* 728x90, oluşturulma 20.07.2011 */
							google_ad_slot = "7550685761";
							google_ad_width = 728;
							google_ad_height = 90;
						//-->
					</script>
					<script type="text/javascript"
						src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
					</script>
				</center>
			</div>	
        </div>
        <!--Orta SON-->
            
        <!--Yan-->
        <div id="yan" class="saga">
        	<?php $this->load->view('frontend/common/side'); ?>
		</div>
		<!--Yan SON-->
		
    	<div class="clear"></div>
</div>
<!-- main SON-->

<!-- HELP -->
<div style="display: none"><div id="raporlar"></div></div>


<script type="text/javascript" charset="utf-8">
	jQuery(document).ready(function(){
		jQuery('#raporlar').load("<?php echo site_url('main/help') ?> #raporlar");
	});
</script>
